package com.yc.baseapi;

import java.util.WeakHashMap;

public class TestWeakHashMap {
	
	public void m() {
		WeakHashMap<Object, Object> map = new WeakHashMap<Object, Object>();
		map.put(1, 11);
		map.put(128, 1288);
		map.put(999, 9999);
		System.out.println(map.get(1));
		System.out.println(map.get(128));
		System.out.println(map.get(999));
		
		System.gc();
		System.out.println("-----after gc-------");
		System.out.println(map.get(1));
		System.out.println(map.get(128));
		System.out.println(map.get(999));
	}

	public static void main(String[] args) {
		TestWeakHashMap twh = new TestWeakHashMap();
		twh.m();

	}

}
